import java.util.Scanner;
public class TestJuly {
    /*public static void Separate(int x) {
        if(x < 10){
            System.out.print(x+" ");
            return ;
        }
        Separate(x/10);
        System.out.print((x % 10) +" ");
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        Separate(a);
    }*/

    public static int sum(int n) {
        if(n > 10)
            return (n % 10)+sum(n/10);
        else
            return n;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = sum(n);
        System.out.println(x);
    }
}